package models

import "gorm.io/gorm"

type Register struct {
	gorm.Model
	Name    string `json:"name" gorm:"type:varchar(30)"`
	Num     int    `json:"num" gorm:"type:int(20)"`
	Cate    string `json:"cate" gorm:"type:varchar(30)"`
	Nums    int    `json:"nums" gorm:"type:char(18)"`
	Img     string `json:"img" gorm:"type:varchar(255)"`
	WeName  string `json:"weName" gorm:"type:varchar(30)"`
	Tel     string `json:"tel" gorm:"type:char(11)"`
	Address string `json:"address" gorm:"type:varchar(255)"`
}

func Add(register *Register) error {
	err = DB.Create(&register).Error
	if err != nil {
		return err
	} else {
		return nil
	}
}
